package br.com.skytef.beans.WEB;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;
import java.util.TimeZone;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;

import br.com.skytef.dao.DaoReportTicket;
import br.com.skytef.entity.TicketVehicleMov;

/**
 * 
 * @author denilson dias
 * 
 */
@ManagedBean(name = "RelatMovVeicBean")
@RequestScoped
@ViewScoped
public class RelatVeiculosEstacionados {
	private List<TicketVehicleMov> vehicleParked;
	private TimeZone timeZone = TimeZone.getDefault();
	private Date initialDate;
	private Date finalDate;

	@PostConstruct
	public void init() throws SQLException{
		this.load();
	}
	
	private void load() {
		try {
			DaoReportTicket dao = new DaoReportTicket();
			vehicleParked = dao.selectTicketParkedAll();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void refresh() {
		System.out.println("refresh");
		this.load();
	}

	/*------------------------------------------------------------------------------------------
	 * Settes and getters
	 ------------------------------------------------------------------------------------------*/
	public List<TicketVehicleMov> getVehicleParked() {
		return vehicleParked;
	}

	public void setVehicleParked(List<TicketVehicleMov> vehicleParked) {
		this.vehicleParked = vehicleParked;
	}

	public Date getInitialDate() {
		return initialDate;
	}

	public void setInitialDate(Date initialDate) {
		this.initialDate = initialDate;
	}

	public Date getFinalDate() {
		return finalDate;
	}

	public void setFinalDate(Date finalDate) {
		this.finalDate = finalDate;
	}

	public TimeZone getTimeZone() {
		return timeZone;
	}

	public void setTimeZone(TimeZone timeZone) {
		this.timeZone = timeZone;
	}
	
	

}
